package com.rightsidetech.mall.dto.request;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
public class CommoditySpecsValueReq implements Serializable {

    @ApiModelProperty(value = "规格值id",required = true)
    @NotNull(message = "规格值id不允许为空")
    @Min(value = 0,message = "id不可为负数")
    private Long id;

    @ApiModelProperty(value = "规格",required = true)
    @NotBlank(message = "规格不可为空")
    @Pattern(regexp = "[\\u4e00-\\u9fa5a-zA-Z0-9-./()【】]{0,20}+",message = "规格不允许特殊字符长度最大为20")
    private String specsValue;
}